<?php
require_once  __DIR__ . '/includes/authenticate.php';

?>

<h2>Admin Tools</h2>

<div class="container-fluid">
	<div class="row">
		<div class="col-md-3"></div>
		<div class="col-md-6">
				<div class="dropdown">
  				<button class="btn btn-default dropdown-toggle" type="button" data-toggle="dropdown">Other Tools
  				<span class="caret"></span></button>
  					<ul class="dropdown-menu">
  						<li><a href="javascript:callAdminPage('admin_addeditgameresults')">Add/Edit Game Result</a></li>
              <li><a href="javascript:callAdminPage('admin_addeditgamecomment')">Add/Edit Game Comment</a></li>
              <li><a href="javascript:callAdminPage('admin_viewgamecomment')">View Game Comment</a></li>
              <li><a href="javascript:callAdminPage('opponents')">Opponents</a></li>
              <li class="divider"></li>
  					 	<li><a href="javascript:callAdminPage('admin_addnewplayer')">Add New Player</a></li>
    					<li><a href="javascript:callAdminPage('admin_addplayertoteam')">Add Player to Team</a></li>
    					<li><a href="javascript:callAdminPage('admin_addopptoseason')">Add Opponent to Season</a></li>
  						<li><a href="javascript:callAdminPage('admin_addgametoseason')">Add Game to Season</a></li>              
    					<li><a href="javascript:callAdminPage('admin_addnewseason')">Add New Season</a></li>
              <li class="divider"></li>
              <li><a href="javascript:callAdminPage('teaminfo')">Team Info</a></li>
              <li><a href="javascript:callAdminPage('serverlog')">Server Log</a></li>
              <li><a href="javascript:callAdminPage('dataviewer')">Data Viewer</a></li>
    				</ul>
    		</div>
    		<br/><br/>
			<div id="admintoolscontent"></div>
		</div>
		<div class="col-md-3"></div>
	</div>

</div>


<script type="text/javascript">

function callAdminPage(page){
$.ajax({
  type: "GET",
  url: "./" + page + ".php",
  success: function(data) {
  	$("#admintoolscontent").html(data);
  }
  }) 
};

$(document).ready(function(){
  $('.dropdown-toggle').dropdown();
})


</script>

